import os
import sys
import site

# One directory above the project, so project name will be needed for imports
root_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))

# with mod_wsgi >= 2.4, this line will add this path in front of the python path
site.addsitedir(os.path.join(root_dir, 'lib/python2.7/site-packages'))
site.addsitedir(os.path.join(root_dir, 'src/bibserver'))

# this line is added so python is aware of the application
# this is absolute path to the app.
#sys.path.append('/home/www-data/statopic/www/ims')
sys.path.append(os.path.join(root_dir, 'www', 'ims'))

# this is simply a check to see if the site is in syspath as well this is one directory up from application
path = '/home/www-data/statopic/www'
if path not in sys.path:
    sys.path.insert(0,path)

# this is the settings file needed to start django with.
os.environ['DJANGO_SETTINGS_MODULE'] = 'ims.settings'

# import handler and activate application
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()


